{% extends 'myadmin/index.html' %}
{% block 'body' %}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title  am-cf">会员列表</div>


                </div>
                <div class="widget-body  am-fr">

                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <button type="button" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</button>
                                    <button type="button" class="am-btn am-btn-default am-btn-secondary"><span class="am-icon-save"></span> 保存</button>
                                    <button type="button" class="am-btn am-btn-default am-btn-warning"><span class="am-icon-archive"></span> 审核</button>
                                    <button type="button" class="am-btn am-btn-default am-btn-danger"><span class="am-icon-trash-o"></span> 删除</button>
                                </div>
                            </div>
                        </div>
                    </div>

                    <form>
                        <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                            <div class="am-form-group tpl-table-list-select">
                                <select name="class" data-am-selected="{btnSize: 'sm'}" style="display: none;">
                                  <option value="username" {% if request.GET.class == 'username' %} selected {% endif %}>会员名</option>
                                  <option value="phone" {% if request.GET.class == 'phone' %} selected {% endif %}>手机号</option>
                                  <option value="sex" {% if request.GET.class == 'sex' %} selected {% endif %}>性别</option>
                                </select>
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                            <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                <input name="keywords" type="text" value="{{ request.GET.keywords }}" class="am-form-field ">
                                <span class="am-input-group-btn">
                                    <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" ></button>
                                </span>
                            </div>
                        </div>
                    </form>

                    <div class="am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                            <thead>
                                <tr>
                                    <th>商品缩略图</th>
                                    <th>商品名称</th>
                                    <th>所属分类</th>
                                    <th>价格</th>
                                    <th>库存</th>
                                    <th>点击数量</th>
                                    <th>购买数量</th>
                                    <th>状态</th>
                                    <th>时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>

                                {% for v in glist %}
                                <tr class="gradeX">
                                    <td>
                                        <img src="/static/goods/{{ v.picname }}" class="tpl-table-line-img" alt="">
                                    </td>
                                    <td class="am-text-middle">{{ v.title }}</td>
                                    <td class="am-text-middle">{{ v.pname }}</td>
                                    <td class="am-text-middle">{{ v.price }} 元</td>
                                    <td class="am-text-middle">{{ v.store }}</td>
                                    <td class="am-text-middle">{{ v.clicknum }}</td>
                                    <td class="am-text-middle">{{ v.num }}</td>
                                   
                                    <td class="am-text-middle">
                                        {% if v.state == 1 %}
                                            新发布
                                        {% elif v.state == 2%}
                                            在售
                                        {% else %}
                                            下架
                                        {% endif %}
                                    </td>
                                    <td class="am-text-middle">{{ v.addtime|date:'Y-m-d' }}</td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="{% url 'myadmin_goodsedit' v.id %}">
                                                <i class="am-icon-pencil"></i> 编辑
                                            </a>
                                            <a href="{% url 'myadmin_goodsdel' v.id %}" class="tpl-table-black-operation-del">
                                                <i class="am-icon-trash"></i> 删除
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                {% endfor %}

       
                                <!-- more data -->
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">

                        {% load pagetag %}
                          <div class="am-fr">
                              <ul class="am-pagination tpl-pagination">
                               
                                <!-- 如果有上一页则输出 -->
                                {% if ulist.has_previous %}
                                      <li><a href="/admin/user/index/{{ ulist.previous_page_number }}?{{ where }}">«</a></li>
                                {% endif %}

                                <!-- 循环页码信息 -->
                                {%  for pg in ulist.paginator.page_range %}
                                    <!-- 
                                        ulist.number 为当前页码  4
                                        pg 为当前循环出来的页码数  1 2 3 4 5 6 7 8 9 10
                                     -->
                                    {% circle_page  ulist.number pg '/admin/user/index/'  where %}

                                {% endfor %}

                                <!-- 如果有下一页则输出 -->
                                {% if ulist.has_next %}
                                  <li class=""><a href="/admin/user/index/{{ ulist.next_page_number }}?{{ where }}">»</a></li>
                                {% endif %}

                              </ul>
                          </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}